

package com.hazelcast.internal.jmx.suppliers;

import com.hazelcast.internal.monitor.impl.EmptyLocalReplicatedMapStats;
import com.hazelcast.replicatedmap.LocalReplicatedMapStats;
import com.hazelcast.replicatedmap.ReplicatedMap;

/**
 * Implementation of {@link StatsSupplier} for {@link LocalReplicatedMapStats}
 */
public class LocalReplicatedMapStatsSupplier implements StatsSupplier<LocalReplicatedMapStats> {

    private final ReplicatedMap<?, ?> map;

    public LocalReplicatedMapStatsSupplier(ReplicatedMap<?, ?> map) {
        this.map = map;
    }

    @Override
    public LocalReplicatedMapStats getEmpty() {
        return new EmptyLocalReplicatedMapStats();
    }

    @Override
    public LocalReplicatedMapStats get() {
        return map.getReplicatedMapStats();
    }
}
